package cn.itlaobing.service;

import cn.itlaobing.dao.VIRDao;
import cn.itlaobing.exception.MyException;
import cn.itlaobing.model.PanationVir;
import cn.itlaobing.model.VIRDto;
import cn.itlaobing.model.VegetableImportRecordModel;

import java.sql.SQLException;
import java.util.List;

/**
 * Created by Administrator on 2017-11-10.
 */
public class VIRService {
    private VIRDao virDao=new VIRDao();
    public PanationVir QueryAll(Integer index, Integer size) throws MyException {
        try {
            return virDao.QueryAll(index,size);
        } catch (SQLException e) {
            e.printStackTrace();
            throw new MyException(e.getMessage());
        }
    }
    public int Delete(String id) throws MyException {
        try {
            return virDao.delete(id);
        } catch (SQLException e) {
            e.printStackTrace();
            throw new MyException(e.getMessage());
        }
    }
    public int update(VegetableImportRecordModel virm) throws MyException {
            try {
                return virDao.update(virm);
            } catch (SQLException e) {
                e.printStackTrace();
                throw new MyException(e.getMessage());
            }

        }
    public VegetableImportRecordModel updateBefore(String id) throws MyException {
        try {
            return virDao.updateBefore(id);
        } catch (SQLException e) {
            e.printStackTrace();
            throw new MyException(e.getMessage());
        }

    }

}
